package cn.edu.hzvtc.haowen.service.impl;

import java.util.List;

import cn.edu.hzvtc.haowen.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.edu.hzvtc.haowen.mapper.WenjuanAnswerMapper;
import cn.edu.hzvtc.haowen.domain.WenjuanAnswer;
import cn.edu.hzvtc.haowen.service.IWenjuanAnswerService;

/**
 * 问卷答卷Service业务层处理
 * 
 * @author haowen
 * @date 2024-05-15
 */
@Service
public class WenjuanAnswerServiceImpl implements IWenjuanAnswerService 
{
    @Autowired
    private WenjuanAnswerMapper wenjuanAnswerMapper;

    /**
     * 查询问卷答卷
     * 
     * @param answerId 问卷答卷主键
     * @return 问卷答卷
     */
    @Override
    public WenjuanAnswer selectWenjuanAnswerByAnswerId(Integer answerId)
    {
        return wenjuanAnswerMapper.selectWenjuanAnswerByAnswerId(answerId);
    }

    /**
     * 查询问卷答卷列表
     * 
     * @param wenjuanAnswer 问卷答卷
     * @return 问卷答卷
     */
    @Override
    public List<WenjuanAnswer> selectWenjuanAnswerList(WenjuanAnswer wenjuanAnswer)
    {
        return wenjuanAnswerMapper.selectWenjuanAnswerList(wenjuanAnswer);
    }

    /**
     * 新增问卷答卷
     * 
     * @param wenjuanAnswer 问卷答卷
     * @return 结果
     */
    @Override
    public int insertWenjuanAnswer(WenjuanAnswer wenjuanAnswer)
    {
        wenjuanAnswer.setCreateTime(DateUtils.getNowDate());
        return wenjuanAnswerMapper.insertWenjuanAnswer(wenjuanAnswer);
    }

    /**
     * 修改问卷答卷
     * 
     * @param wenjuanAnswer 问卷答卷
     * @return 结果
     */
    @Override
    public int updateWenjuanAnswer(WenjuanAnswer wenjuanAnswer)
    {
        return wenjuanAnswerMapper.updateWenjuanAnswer(wenjuanAnswer);
    }

    /**
     * 批量删除问卷答卷
     * 
     * @param answerIds 需要删除的问卷答卷主键
     * @return 结果
     */
    @Override
    public int deleteWenjuanAnswerByAnswerIds(Integer[] answerIds)
    {
        return wenjuanAnswerMapper.deleteWenjuanAnswerByAnswerIds(answerIds);
    }

    /**
     * 删除问卷答卷信息
     * 
     * @param answerId 问卷答卷主键
     * @return 结果
     */
    @Override
    public int deleteWenjuanAnswerByAnswerId(Integer answerId)
    {
        return wenjuanAnswerMapper.deleteWenjuanAnswerByAnswerId(answerId);
    }
}
